<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<script>
	function Person(){
		
	};
	
	Person.prototype.name='blue';
	
	Person.prototype.age=18;
	
	Person.prototype.job='daza';
	
	Person.prototype.showName=function(){
		console.log(this.name);	
	};
	
	console.log(Person);//function Person(){};
	console.log(Person.prototype);//Person {name: "blue", age: 18, job: "daza"}
	
	console.log(Person.prototype.constructor);//function Person(){};
		//constructor: Person()
		//job: "daza"
		//name: "blue"
		//showName: ()
		//__proto__: Object
	
	
	Person.prototype={
		constructor: Person,
		name: 'blue',
		age: 18,
		job: 'daza',
		showName: function(){
			console.log(this.name);	
		}
	};
	
	console.log(Person.prototype);//Object {name: "yousi", age: 18, job: "manong"}
	console.log(Person.prototype.constructor)//function Object() { [native code] };
	
	var p1=new Person();
	
	console.log(p1 instanceof Object);//true;
	console.log(p1 instanceof Person);//true;
	
	console.log(p1.constructor == Object);//true;
	
	console.log(p1.constructor == Person);//false;
	console.log(p1.constructor.prototype);//Person {name: "blue", age: 18, job: "daza"}
	console.log(p1.constructor.prototype.age);//blue
</script>
</head>

<body>
</body>
</html>
 